package com.devgear.codesizer.model;

// Generated 24-oct-2011 0:54:57 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TemplateProjectType generated by hbm2java
 */
@Entity
@Table(name = "t_project_types", schema = "public")
public class TemplateProjectType implements java.io.Serializable {

	private int idProjectType;
	private String name;
	private Set<TemplateProjectTypeActivity> templateProjectTypeActivities = new HashSet<TemplateProjectTypeActivity>(
			0);
	private Set<TemplateProjectTypeFeatureType> templateProjectTypeFeatureTypes = new HashSet<TemplateProjectTypeFeatureType>(
			0);
	private Set<TemplateParameterType> templateParameterTypes = new HashSet<TemplateParameterType>(
			0);

	public TemplateProjectType() {
	}

	public TemplateProjectType(int idProjectType) {
		this.idProjectType = idProjectType;
	}

	public TemplateProjectType(
			int idProjectType,
			String name,
			Set<TemplateProjectTypeActivity> templateProjectTypeActivities,
			Set<TemplateProjectTypeFeatureType> templateProjectTypeFeatureTypes,
			Set<TemplateParameterType> templateParameterTypes) {
		this.idProjectType = idProjectType;
		this.name = name;
		this.templateProjectTypeActivities = templateProjectTypeActivities;
		this.templateProjectTypeFeatureTypes = templateProjectTypeFeatureTypes;
		this.templateParameterTypes = templateParameterTypes;
	}

	@Id
	@Column(name = "id_project_type", unique = true, nullable = false)
	public int getIdProjectType() {
		return this.idProjectType;
	}

	public void setIdProjectType(int idProjectType) {
		this.idProjectType = idProjectType;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "templateProjectType")
	public Set<TemplateProjectTypeActivity> getTemplateProjectTypeActivities() {
		return this.templateProjectTypeActivities;
	}

	public void setTemplateProjectTypeActivities(
			Set<TemplateProjectTypeActivity> templateProjectTypeActivities) {
		this.templateProjectTypeActivities = templateProjectTypeActivities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "templateProjectType")
	public Set<TemplateProjectTypeFeatureType> getTemplateProjectTypeFeatureTypes() {
		return this.templateProjectTypeFeatureTypes;
	}

	public void setTemplateProjectTypeFeatureTypes(
			Set<TemplateProjectTypeFeatureType> templateProjectTypeFeatureTypes) {
		this.templateProjectTypeFeatureTypes = templateProjectTypeFeatureTypes;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "t_project_type_parameter_types", schema = "public", joinColumns = { @JoinColumn(name = "id_project_type", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "id_parameter_type", nullable = false, updatable = false) })
	public Set<TemplateParameterType> getTemplateParameterTypes() {
		return this.templateParameterTypes;
	}

	public void setTemplateParameterTypes(
			Set<TemplateParameterType> templateParameterTypes) {
		this.templateParameterTypes = templateParameterTypes;
	}

}
